package com.zzz.gp.controller;

import com.alibaba.fastjson.JSONObject;
import com.zzz.gp.service.CommonService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * @description:
 * @author: ZZZ
 * @time: 2022/1/26 14:05
 */
@Slf4j
@RestController
@RequestMapping("/common")
public class CommonController {
    @Autowired
    private CommonService commonService;


    @RequestMapping("/qc")
    public String QC() {
        commonService.qc();
        String result = "QC  exe success";
        log.info(result);
        return result;
    }

    @RequestMapping("/test/*")
    public Object Test(@RequestBody Map<String, Object> map, HttpServletRequest request) {
        map.put("url", request.getRequestURI());
        map.put("method", request.getMethod());
        String s = JSONObject.toJSONString(map);
        System.out.println(s);
        return map;
    }

}
